Skip to content

Extract duplicated API error handling into shared extensions#19

Merged
dadachi merged 1 commit intomainfrom
extract_api_error_handling
Mar 27, 2026
Merged

Extract duplicated API error handling into shared extensions#19
dadachi merged 1 commit intomainfrom
extract_api_error_handling

Conversation

@dadachi
Copy link
Copy Markdown
Contributor

@dadachi dadachi commented Mar 27, 2026

Summary

  • Added ApiResponseExtensions.kt with reusable emitApiResponse() and throwApiError() functions in the network package
  • Replaced duplicated suspendOnSuccess/suspendOnFailure error handling boilerplate across all 5 repository implementations
  • Net reduction of ~360 lines of code (+160 -522)

Test plan

  • ./gradlew assembleDebug builds successfully
  • ./gradlew test all unit tests pass
  • ./gradlew spotlessCheck passes
  • Verify API error responses still display correct messages in the app

🤖 Generated with Claude Code

- Add ApiResponseExtensions.kt with reusable emitApiResponse() and
  throwApiError() functions in the network package
- Replace duplicated suspendOnSuccess/suspendOnFailure error handling
  boilerplate across all 5 repository implementations
- Net reduction of ~360 lines of code (+160 -522)

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@dadachi dadachi merged commit 6b0b639 into main Mar 27, 2026
1 check passed
@dadachi dadachi deleted the extract_api_error_handling branch March 27, 2026 10:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant